<?php

class PagesHtmlImageHandle{
    public function html($pageId, $html) {
        $httpRequest = new \Request();
        $result = $httpRequest->post(HANDLER_HTML_API, ['idPk' => $pageId, 'html' => $html, 'savePageDb' => '1'], "form");
        if(!empty($result)) {
            if(!empty($result['data']['handleHtml'])) {
                return $result['data']['handleHtml'];
            }
        }
        return $html;
    }
}
